package com.jimikongjian.dao;

import com.jimikongjian.models.Notification;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by fuxiuyang on 17/2/20.
 */
public interface INotification {

    /**
     * 通过自身的id获取某一确定的通知信息
     * @param id
     * @return List<Notification>
     */
    public List<Notification> getNotificationListById(int id);

    /**
     * 通过自身的id获取某一确定的通知信息
     * @param id
     * @return Notification
     */
    public Notification getNotificationById(int id);

    /**
     * 获取用户创建的所有的通知
     * @param notifyId
     * @return List<Notification>
     */
    public List<Notification> getNotificationListByNotifyId(@Param("notifyId") int notifyId,
                                                            @Param("start") int start,
                                                            @Param("length") int length);

    /**
     * 获取用户创建的所有未读的通知
     * @param notifyId
     * @return List<Notification>
     */
    public List<Notification> getUnreadNotificationListByNotifyId(@Param("notifyId") int notifyId,
                                                                  @Param("start") int start,
                                                                  @Param("length") int length);

    /**
     * 获取被通知用户的所有的通知
     * @param notifiedId
     * @param start
     * @param length
     * @return List<Notification>
     */
    public List<Notification> getNotificationListByNotifiedId(@Param("notifiedId") int notifiedId,
                                                              @Param("start") int start,
                                                              @Param("length") int length);

    /**
     * 获取被通知用户的所有的未读的通知
     * @param notifiedId
     * @param start
     * @param length
     * @return List<Notification>
     */
    public List<Notification> getUnreadNotificationListByNotifiedId(@Param("notifiedId") int notifiedId,
                                                                    @Param("start") int start,
                                                                    @Param("length") int length);

    /**
     * 获取被通知用户的所有的未读的通知
     * @param notifiedId
     * @return List<Notification>
     */
    public List<Notification> getUnreadCountByNotifiedId(@Param("notifiedId") int notifiedId);

    /**
     * 创建一条新的通知
     * @param notification
     */
    public void insertNotifications(Notification notification);

    /**
     * 更新一条通知
     * @param notification
     */
    public void updateNotifications(Notification notification);

    /**
     * 删除一条通知
     * @param notification
     */
    public void deleteNotifications(Notification notification);
}
